library(haven)
library(ggplot2)
library(Hmisc)
library(scales)


#####################################################################################################################
# Replication code for "Corrupted Estimates? Response Bias in Citizen Surveys on Corruption", Political Behavior
# Author: Mattias Agerberg, University of Gothenburg, mattias.agerberg@gu.se
# MAIN MANUSCRIPT
#####################################################################################################################


# Data, WVS
setwd("") 
wvsRO <- readRDS("wvsRO.rds")

# FIGURE 1
labels <- c("Never justifiable","","","","","","","","","Always justifiable")

ggplot(wvsRO, aes(V202)) +
  geom_bar(aes(y = (..count..)/sum(..count..)), colour="black", fill="grey20", alpha = 0.75) +
    labs(title="Justifiable: Someone accepting a bribe", y="Share", x="") +
    scale_x_discrete(labels = labels, limits = seq(1,10,1)) +
    theme_minimal(base_size = 12)
ggsave("justified.pdf")